acpi: Fix out of bounds access in grub_acpi_xsdt_find_table()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 16 Oct 2024 05:20:24 +0000 (16:20 +1100)
committerMiao Wang <shankerwangmiao@gmail.com>
Sun, 15 Feb 2026 13:50:20 +0000 (13:50 +0000)
commitc4c6445bcd1f499643bb187daac11ede08f024b7
tree5096adac68c00a83691fdd219d71706b0c4a6057
parent1ee13b8d75da2fcb037572f46add90a16ceae257
acpi: Fix out of bounds access in grub_acpi_xsdt_find_table()

The calculation of the size of the table was incorrect (copy/pasta from
grub_acpi_rsdt_find_table() I assume...). The entries are 64-bit long.

This causes us to access beyond the end of the table which is causing
crashes during boot on some systems. Typically this is causing a crash
on VMWare when using UEFI and enabling serial autodetection, as

grub_acpi_find_table (GRUB_ACPI_SPCR_SIGNATURE);

Will goes past the end of the table (the SPCR table doesn't exits)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Gbp-Pq: Topic upstream
Gbp-Pq: Name acpi-Fix-out-of-bounds-access-in-grub_acpi_xsdt_find_tabl.patch
grub-core/kern/acpi.c